package com.mayuran19.portal.web.accounting.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.mayuran19.portal.common.service.ProductService;
import com.mayuran19.portal.common.ui.pagination.Pager;

@Controller
public class ProductsController {
	private ProductService productService;

	@Autowired
	public void setProductService(ProductService productService) {
		this.productService = productService;
	}

	@RequestMapping(value = "/accounting/products/list")
	public String list(Model model, Pager pager) {
		model.addAttribute("pager", this.productService.paginate(pager));
		return "product.list";
	}
}
